from flask import Flask

from flask_mongoengine import MongoEngine

db = MongoEngine()

#创建Flask实例
def create_app():
    app = Flask(__name__)

    # config 放在app应用目录下
    #app.config.from_object('app.config')

    # config 放在根目录下
    app.config.from_object('config')

    db.init_app(app)

    from app.news import news as news_blueprint
    app.register_blueprint(news_blueprint, url_prfix="/news")

    return app





